﻿
Imports System.IO
Imports xmlctrl
Imports xhtmlctrl

Public Class rails
    Inherits table

    Default Public ReadOnly Property getrail(ByVal index As Int64) As xhtmlControl
        Get
            Return children()(index)
        End Get
    End Property

    Public Sub increaseRails(ByVal count As Int64)
        Dim i As Int64
        For i = 0 To count - 1
            MyBase.addchild(New td(output()))
        Next
    End Sub

    Public Sub New(Optional ByVal buff As Stream = Nothing)
        MyBase.New(buff)
    End Sub

    Public Overrides Sub addchild(ByVal ctrl As xmlctrl.xmlcontrol)
        addchild(ctrl, 0)
    End Sub

    Public Overloads Function addchild(ByVal ctrl As xmlcontrol, ByVal index As Int64) As Boolean
        Dim rail As xhtmlControl = Nothing
        rail = getrail(index)
        If Not rail Is Nothing Then
            rail.addchild(ctrl)
            Return True
        Else
            Return False
        End If
    End Function

End Class
